<!--
  @author nowind
  @since 2018/10/19 08:59
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title>产品配件分类关联</title>
</head>
<body>

<div class="layui-fluid">

    <blockquote class="layui-crumb">
        <span>配件管理</span>>
        <a lay-href="/part/category/map/list.action">分类关联</a>
    </blockquote>

    <div class="layui-card">

        <div class="layui-split">&nbsp;</div>

        <div class="layui-form" th:include="part/category/map/_query :: query "></div>

        <div class="layui-card-body">
            <table class="layui-hide" id="zmn-part-category-map-table" lay-filter="zmn-part-category-map-table"></table>
        </div>

    </div>

</div>

<script type="text/javascript" th:inline="javascript">

    let permission = {
        hasEdit: [[${#authPermit.checkPermit('/part/category/map/addEdit.action')}]],
    };

    layui.config({
        base: "/static/lay/",
        version: 202009091554
    }).extend({
        index: "lib/index",
        plat_part_category_map_list: "{/}/static/js/module/part/category/map/zmn.plat.category.map.list"
    }).use(['index', 'plat_part_category_map_list']);

</script>

<script type="text/html" id="zmn-part-category-map-table-tool">
    {{#  if(permission.hasEdit){ }}
    <div class="layui-btn-container">
        <div class="layui-btn-group">
            <button lay-event="add" class="layui-btn layui-btn-sm layui-btn-primary">添加关联</button>
            <button lay-event="delBatch" class="layui-btn layui-btn-sm layui-btn-danger">批量删除</button>
            <!--
                <a lay-href="/part/addedit/" class="layui-btn layui-btn-sm" lay-text="添加关联">添加关联</a>
                <a lay-href="/part/addedit/" class="layui-btn layui-btn-sm" lay-text="批量删除">批量删除</a>
               -->
        </div>
    </div>
    {{#  } }}
</script>

<div class="layui-hide">
    <div id="zmn-part-category-map-edit">
        <form method="post" action="" lay-filter="zmn-purchase-apply-form">
            <div class="layui-card" style="padding-right: 20px">
                <input type="text" name="mapId" class="layui-input layui-hide"/>
                <div class="layui-split">&nbsp;</div>
                <div class="layui-row">
                    <div class="layui-col-md12">
                        <div class="layui-form-item layui-form-item-sm">
                            <label class="layui-form-label layui-form-label-extend">产品一级分类<span style="color: red">*</span></label>
                            <div class="layui-input-block layui-input-block-extend" style="max-width: 300px">
                                <select name="baseCategId" lay-filter="baseCategId" lay-verify="required">
                                    <option value="">请选择</option>
                                    <option th:each="baseCateSimple:${baseCategorySimpleList}"
                                            th:value="${baseCateSimple?.value}"
                                            th:selected="${baseCateSimple?.value == categoryMap?.baseCategId}"
                                            th:text="|${baseCateSimple?.text}|">
                                    </option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md12">
                        <div class="layui-form-item layui-form-item-sm">
                            <label class="layui-form-label layui-form-label-extend">配件一级分类<span style="color: red">*</span></label>
                            <div class="layui-input-block layui-input-block-extend" style="max-width: 300px">
                                <select name="categId" lay-filter="categId" lay-verify="required">
                                    <option value="">请选择</option>
                                    <option th:each="partCateSimple:${partCategorySimpleList}"
                                            th:value="${partCateSimple?.value}"
                                            th:disabled="${!partCateSimple?.status}"
                                            th:text="|${partCateSimple?.text}${partCateSimple?.status?'':'(已禁用)'}|">
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-split">&nbsp;</div>

            </div>
            <div class="layui-form-item layui-layout-admin">
                <div class="layui-input-block">
                    <div style="left: 0;">
                        <button type="submit" class="layui-btn" lay-submit
                                lay-filter="zmn-part-category-map-submit">保存
                        </button>
                        <button type="button" class="layui-btn layui-btn-danger"
                        >
                            取消
                        </button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

</body>

</html>